-
-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore embedded scripts when asked #234
Conversation
@@ -1,6 +1,9 @@ | |||
# encoding: utf-8 | |||
|
|||
class HtmlCheck < ::HTML::Proofer::CheckRunner | |||
class HtmlCheckable < ::HTML::Proofer::Checkable | |||
|
|||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this class HtmlCheckable
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I added it while testing something out. It's unnecessary.
It would be nice if html-proofer supported multiple html validators like vnu. My current setup disables html validation via proofer and instead uses vnu for that. |
That's a pretty good idea. It might be a pain to integrate a Java executable into this Ruby library though. |
@@ -0,0 +1,3 @@ | |||
<script type="text/html" id="navbar-logged-in" data-proofer-ignore> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove data-proofer-ignore
from this fixture. The spec “ignores embeded scripts when asked” must pass without the attribute.
Hey @gjtorikian. Was wondering if there's anything currently in the way of merging this. |
Ignore embedded scripts when asked
@geobrando Sorry! This is now out in 2.4.0: https://github.com/gjtorikian/html-proofer/releases/tag/v2.4.0 |
Thanks! |
I'm wondering if I'm missing something. Either I don't know what I'm doing or there is something wrong with the tests.
require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
gem 'html-proofer', github: 'gjtorikian/html-proofer', :tag => 'v2.4.2'
end
HTML::Proofer.new("./files",{:check_html => true, :ignore_script_embeds => true}).run running with the fixture in
|
Hey @gjtorikian. Is this working as intended? |
I'm also still seeing the |
The documentation is wrong, but the feature is working. The options should be passed like this: opts = { :check_html => true, :validation => { :ignore_script_embeds => true } } That is, within the |
@gjtorikian Ah. You are correct. Looking at the binary, I think something needs to be changed to produce the proper namespaced option when using From my limited knowledge of ruby it looks like you're mapping the CL flags directly to options that you pass to |
Closes #233.
This PR proposes to add a new option,
ignore_script_embeds
, to resolve errors that readElement script embeds close tag
.I'm not 100% sure this is still the best way to handle this, but it might be the only way. From what I read in Nokogiri's docs, there's pretty much no information given from a parse error.
/cc @akshayrawat